package cn.area.view;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.util.Log;

import cn.area.R;

import com.baidu.mapapi.MapView;

public class MyMapView extends MapView{

	Context context;
	int left,top;
	
	public MyMapView(Context context) {
		super(context);
		this.context = context;
	}
	
	
	
	public MyMapView(Context arg0, AttributeSet arg1, int arg2) {
		super(arg0, arg1, arg2);
		// TODO Auto-generated constructor stub
	}



	public MyMapView(Context arg0, AttributeSet arg1) {
		super(arg0, arg1);
		// TODO Auto-generated constructor stub
	}


	@Override
	public void draw(Canvas canvas) {
		// TODO Auto-generated method stub
		super.draw(canvas);
		Log.i("MyMapView", "重画");
		Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
				R.drawable.usericon);
		canvas.drawBitmap(bitmap, left, top, null);
	}
	
	
	
	public void reDraw(int left,int top){
		
		Log.i("MyMapView", "进入reDraw");
		
		this.top = left;
		this.left = top;
		invalidate();
		
	}
	

}
